//
//  WYCMeWalletController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/2.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCMeWalletController.h"
#import "WYCRechargeController.h"
#import "WYCDrawalsController.h"

@interface WYCMeWalletController ()

@end

@implementation WYCMeWalletController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //界面布局
    [self setupCreat];
    
    
    //底部的充值和提ui
    [self setupBotton];
    
    
    
}

#pragma make ------->>底部的提现和充值
- (void)setupBotton{
    
    //底部充值和提现
    UIView * BottomView = [[UIView alloc] init];
    BottomView.frame = CGRectMake(0, ScreenHeight - 200 * px, ScreenWidth, 200 * px);
    BottomView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:BottomView];
    
    
    //充值
    UIButton * RechargeButton = [[UIButton alloc] init];
    RechargeButton.frame = CGRectMake(0, 0, BottomView.width / 2, BottomView.height);
    [RechargeButton setTitle:@"充值" forState:UIControlStateNormal];
    RechargeButton.titleLabel.font = sevenRegular;
    [RechargeButton addTarget:self action:@selector(RechargeButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [RechargeButton setTitleColor:WYZBlackBg forState:UIControlStateNormal];
    RechargeButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [BottomView addSubview:RechargeButton];
    
    
    //提现
    UIButton * WithdrawalsButton = [[UIButton alloc] init];
    WithdrawalsButton.frame = CGRectMake(CGRectGetMaxX(RechargeButton.frame), 0, BottomView.width / 2, BottomView.height);
    [WithdrawalsButton setTitle:@"提现" forState:UIControlStateNormal];
    [WithdrawalsButton addTarget:self action:@selector(WithdrawalsButtonClick) forControlEvents:UIControlEventTouchUpInside];
    WithdrawalsButton.titleLabel.font = sevenRegular;
    WithdrawalsButton.backgroundColor = bigredColor;
    [WithdrawalsButton setTitleColor:wycwhiteColor forState:UIControlStateNormal];
    WithdrawalsButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [BottomView addSubview:WithdrawalsButton];
}

#pragma make ------->>界面布局
- (void)setupCreat{
    
    //界面背景颜色
    self.view.backgroundColor = WYCGlobalBg;
    UIView * backView = [[UIView alloc] init];
    backView.backgroundColor = bigredColor;
    backView.frame = CGRectMake(0, 0, ScreenWidth, 880 * px);
    [self.view addSubview:backView];
    
    //Nav添加控件
    UIView *navView = [[UIView alloc] init];
    navView.frame = CGRectMake(0, 40 * px, ScreenWidth, 160 * px);
    navView.backgroundColor = trpColor;
    [backView addSubview:navView];
    
    //返回按钮
    UIButton * backButton = [[UIButton alloc] init];
    backButton.frame = CGRectMake(20 * px, 40 * px, 80 * px, 80 * px);
    [backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [backButton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [navView addSubview:backButton];
    
    
    //Nav钱包
    UILabel * NavLabel = [[UILabel alloc] init];
    NavLabel.frame = CGRectMake(ScreenWidth / 2 - 120 * px, 40 * px, 240 * px, 60 * px);
    NavLabel.text = @"我的钱包";
    NavLabel.font = MiddleLight;
    NavLabel.font = [UIFont boldSystemFontOfSize:BigMiddleFont];
    NavLabel.textColor = [UIColor whiteColor];
    [navView addSubview:NavLabel];
    
    
    //金额数量
    UILabel * maneylabel = [[UILabel alloc] init];
    maneylabel.frame = CGRectMake(0, CGRectGetMaxY(NavLabel.frame) + 120 * px, ScreenWidth, 100 * px);
    maneylabel.textColor = [UIColor whiteColor];
    maneylabel.text = @"10000.00";
    maneylabel.font = [UIFont systemFontOfSize:SuperBigFont];
    maneylabel.textAlignment = NSTextAlignmentCenter;
    maneylabel.font = [UIFont boldSystemFontOfSize:SuperBigFont];
    [navView addSubview:maneylabel];
    
    //当前账户余额
    UILabel * currentaccountlabel = [[UILabel alloc] init];
    currentaccountlabel.frame = CGRectMake(0, CGRectGetMaxY(maneylabel.frame) + 80 * px, ScreenWidth, 100 * px);
    currentaccountlabel.textColor = [UIColor whiteColor];
    currentaccountlabel.text = @"当前账户余额";
    currentaccountlabel.font = [UIFont systemFontOfSize:WyzFont];
    currentaccountlabel.textAlignment = NSTextAlignmentCenter;
    [navView addSubview:currentaccountlabel];
    
    
    UIView *PinkbackView = [[UIView alloc] init];
    PinkbackView.frame = CGRectMake(0, CGRectGetMaxY(currentaccountlabel.frame) + 80 * px, ScreenWidth, 280 * px);
    PinkbackView.backgroundColor = WYCRGBColor(228, 1, 74);
    [navView addSubview:PinkbackView];
    
    
    //颜色渲染不清晰加一条线解决
    UIView *PinklineView = [[UIView alloc] init];
    PinklineView.frame = CGRectMake(0, 0, ScreenWidth, 1);
    PinklineView.backgroundColor = WYCRGBColor(228, 29, 92);
    [PinkbackView addSubview:PinklineView];
    
    
    //返佣收益
    UILabel * ProfitLable = [[UILabel alloc] init];
    ProfitLable.frame = CGRectMake(0, 40 * px, PinkbackView.width / 2, PinkbackView.height / 2 - 20 * px);
    ProfitLable.text = @"500.00";
    ProfitLable.textColor = [UIColor whiteColor];
    ProfitLable.font = [UIFont systemFontOfSize:BigFont];
    ProfitLable.textAlignment = NSTextAlignmentCenter;
    [PinkbackView addSubview:ProfitLable];
    
    
    //返佣收益提示
    UILabel * showProfitLable = [[UILabel alloc] init];
    showProfitLable.frame = CGRectMake(0, CGRectGetMaxY(ProfitLable.frame), PinkbackView.width / 2, PinkbackView.height / 2 - 20 * px);
    showProfitLable.text = @"返佣收益";
    showProfitLable.textColor = [UIColor whiteColor];
    showProfitLable.font = [UIFont systemFontOfSize:SmallFont];
    showProfitLable.textAlignment = NSTextAlignmentCenter;
    [PinkbackView addSubview:showProfitLable];
    
    
    
    //分割线
    UIView * DivisionView = [[UIView alloc] init];
    DivisionView.frame = CGRectMake(ScreenWidth / 2, 40 * px, 1, PinkbackView.height - 80 * px);
    DivisionView.backgroundColor = [UIColor whiteColor];
    [PinkbackView addSubview:DivisionView];
    
    
    
    //银行卡张数
    UILabel * NumberLable = [[UILabel alloc] init];
    NumberLable.frame = CGRectMake(CGRectGetMaxX(DivisionView.frame), 40 * px, PinkbackView.width / 2, PinkbackView.height / 2 - 20 * px);
    NumberLable.text = @"5";
    NumberLable.textColor = [UIColor whiteColor];
    NumberLable.font = [UIFont systemFontOfSize:BigFont];
    NumberLable.textAlignment = NSTextAlignmentCenter;
    [PinkbackView addSubview:NumberLable];
    
    
    //返佣收益提示
    UILabel * showcardLable = [[UILabel alloc] init];
    showcardLable.frame = CGRectMake(NumberLable.x, CGRectGetMaxY(NumberLable.frame), PinkbackView.width / 2, PinkbackView.height / 2 - 20 * px);
    showcardLable.text = @"银行卡";
    showcardLable.textColor = [UIColor whiteColor];
    showcardLable.font = [UIFont systemFontOfSize:SmallFont];
    showcardLable.textAlignment = NSTextAlignmentCenter;
    [PinkbackView addSubview:showcardLable];
}

#pragma make ------>>充值事件
- (void)RechargeButtonClick{
    WYCRechargeController * recharge = [[WYCRechargeController alloc] init];
    [self.navigationController pushViewController:recharge animated:NO];
    
}


#pragma make ------>>提现事件
- (void)WithdrawalsButtonClick{
    WYCDrawalsController * drawals = [[WYCDrawalsController alloc] init];
    [self.navigationController pushViewController:drawals animated:NO];
    
}

#pragma make ------>>进入控制器隐藏
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}
#pragma make ------>>离开控制器显示
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
#pragma make -------->>返回按钮点击事件
- (void)backButtonClick{
    [self.navigationController popViewControllerAnimated:NO];
    
}
@end
